#ifndef CLIENT_H
#define CLIENT_H
#ifdef _WIN32
#include <winsock2,h>
#pragma comment(lib,"Ws2_32.lib")
#endif
#ifdef linux
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <exception>
#include <iostream>
#include <string>
#include "data.h"
#include "map.h"
using namespace std;
class client
{
private :
	int cl;//client sock
	int port;//port server
	string user;
	char sv_addr[32];
	sockaddr_in server;
	map *table;
	data buff;
	data sent;
	//khoi tao afxsocket
	int init();
	void getparametter();
	int createsocket();
	void clientconnect();
	int clientsend();
	void clientrecv();
	void login();
	void playgame();
	void finish();
public:
	client();
	~client();
	void run();

};
#endif // CLIENT_H
